const fs = require('fs');

const encodeImage = (buffer) => {
    return buffer.toString('base64');
};

const validateImage = (file) => {
    const allowedTypes = ['image/jpeg', 'image/png'];
    const maxSize = 5 * 1024 * 1024; // 5MB

    if (!allowedTypes.includes(file.mimetype)) {
        throw new Error('仅支持JPEG/PNG格式');
    }


};

module.exports = { encodeImage, validateImage };